package com.example.administrator.yunniuusedcar.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.model.mode_benn.JiFenShoppingBean;
import com.squareup.picasso.Picasso;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.net.URL;
import java.util.List;

/**  豪车 积分  首页 适配器
 *
 *
 *
 * Created by Administrator on 2017/12/20.
 */

public class JiFenCategoryAdapter extends CommonAdapter<JiFenShoppingBean.DataX> {

    public JiFenCategoryAdapter(Context context, int layoutId, List<JiFenShoppingBean.DataX> datas) {
        super(context, layoutId, datas);

    }

    @Override
    protected void convert(ViewHolder holder, JiFenShoppingBean.DataX dataX, int position) {
        //找控件   设值
        holder.setText(R.id.tv_title3,dataX.data.get(position).goods_name)
                .setText(R.id.tv_Money3,dataX.data.get(position).shop_price);

        Picasso.with(holder.itemView.getContext()).load(dataX.data.get(position).goods_img)    // 加载图片
                .into((ImageView) holder.getView(R.id.iv_Jifenpager));

    }
}
